VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "NaMAG v0.2"
   ClientHeight    =   3510
   ClientLeft      =   45
   ClientTop       =   675
   ClientWidth     =   6975
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3510
   ScaleWidth      =   6975
   StartUpPosition =   2  'CenterScreen
   Begin VB.ListBox filterSemi2 
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   1785
      ItemData        =   "Form1.frx":0000
      Left            =   4560
      List            =   "Form1.frx":0002
      TabIndex        =   19
      Top             =   5040
      Width           =   2175
   End
   Begin VB.ListBox filterSemi 
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   1785
      ItemData        =   "Form1.frx":0004
      Left            =   0
      List            =   "Form1.frx":0006
      TabIndex        =   17
      Top             =   5040
      Width           =   2175
   End
   Begin VB.ListBox List3 
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   1785
      ItemData        =   "Form1.frx":0008
      Left            =   2280
      List            =   "Form1.frx":000A
      TabIndex        =   16
      Top             =   5040
      Width           =   2175
   End
   Begin VB.CommandButton Command4 
      Caption         =   "&Save MACs"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5160
      TabIndex        =   15
      Top             =   1320
      Width           =   1695
   End
   Begin VB.Timer tmrTEST 
      Enabled         =   0   'False
      Interval        =   1
      Left            =   4680
      Top             =   4320
   End
   Begin VB.TextBox Text2 
      Height          =   285
      Left            =   5280
      TabIndex        =   14
      Text            =   "Text2"
      Top             =   3720
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.ListBox listVert2 
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   1395
      ItemData        =   "Form1.frx":000C
      Left            =   2280
      List            =   "Form1.frx":000E
      TabIndex        =   13
      Top             =   3600
      Width           =   2175
   End
   Begin VB.ListBox listVert 
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   1395
      ItemData        =   "Form1.frx":0010
      Left            =   0
      List            =   "Form1.frx":0012
      TabIndex        =   12
      Top             =   3600
      Width           =   2175
   End
   Begin VB.Frame Frame3 
      Caption         =   "Generated List:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2175
      Left            =   120
      TabIndex        =   10
      Top             =   120
      Width           =   2415
      Begin VB.ListBox List1 
         Appearance      =   0  'Flat
         BackColor       =   &H00000000&
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H0000FF00&
         Height          =   1785
         ItemData        =   "Form1.frx":0014
         Left            =   120
         List            =   "Form1.frx":0016
         TabIndex        =   11
         Top             =   240
         Width           =   2175
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "Verified List:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2175
      Left            =   2640
      TabIndex        =   8
      Top             =   120
      Width           =   2415
      Begin VB.ListBox List2 
         Appearance      =   0  'Flat
         BackColor       =   &H00000000&
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H0000FF00&
         Height          =   1785
         ItemData        =   "Form1.frx":0018
         Left            =   120
         List            =   "Form1.frx":001A
         TabIndex        =   9
         Top             =   240
         Width           =   2175
      End
   End
   Begin VB.CommandButton Command3 
      Caption         =   "&Verify List"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5160
      TabIndex        =   7
      Top             =   960
      Width           =   1695
   End
   Begin VB.Frame Frame1 
      Caption         =   "Configuration:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   120
      TabIndex        =   4
      Top             =   2280
      Width           =   4935
      Begin VB.CheckBox Check1 
         Caption         =   "Save without Semicolons?"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   18
         Top             =   720
         Value           =   1  'Checked
         Width           =   2895
      End
      Begin MSComDlg.CommonDialog CommonDialog1 
         Left            =   4320
         Top             =   600
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
      End
      Begin VB.Timer tmrBTN 
         Enabled         =   0   'False
         Interval        =   1
         Left            =   3960
         Top             =   120
      End
      Begin VB.OptionButton Option2 
         Caption         =   "[Hardcode = Disable / Semi = Enable]"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   6
         Top             =   480
         Width           =   4095
      End
      Begin VB.OptionButton Option1 
         Caption         =   "[Hardcode = Enable / Semi = Enable]"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   5
         Top             =   240
         Value           =   -1  'True
         Width           =   4215
      End
   End
   Begin VB.Timer tmrCNT 
      Interval        =   1
      Left            =   4800
      Top             =   1200
   End
   Begin VB.CommandButton Command2 
      Caption         =   "&Save Verified"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5160
      TabIndex        =   2
      Top             =   600
      Width           =   1695
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   5160
      MaxLength       =   8
      TabIndex        =   1
      Text            =   "1024"
      Top             =   1800
      Width           =   1695
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Generate MACs"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5160
      TabIndex        =   0
      Top             =   240
      Width           =   1695
   End
   Begin VB.Label Label1 
      Caption         =   "List Count: 0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1215
      Left            =   5160
      TabIndex        =   3
      Top             =   2160
      Width           =   1695
   End
   Begin VB.Menu mnuAbout 
      Caption         =   "&About"
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim tVal As String
Dim nVal As String
Dim sVal As String
Dim cVal As Integer
Dim listVerMAC() As String
Dim myMac As String
Dim myMac2() As String
Dim intAdd As Long
Dim intAddMAX As Long
Dim myArray() As String
Dim myArray2() As String
Const APPVER = "0.2"
Private Sub Command1_Click()
On Error Resume Next
intAdd = 0
Text1.Text = TrimAlpha(Text1.Text)
Text1.Enabled = False
If Option1.Value = True Then
List1.Clear
List3.Clear
intAddMAX = Text1.Text
Do Until intAdd = intAddMAX
List1.AddItem GenHex1

Text2.Text = List1.Text
myMac = CStr(Text2.Text)
myMac2 = Split(CStr(myMac), ":")
List3.AddItem myMac2(0) & ":" & myMac2(1) & ":" & myMac2(2)

List1.ListIndex = List1.ListIndex + 1
     intAdd = intAdd + 1
    
Loop

ElseIf Option2.Value = True Then
List1.Clear
List3.Clear
intAddMAX = Text1.Text
Do Until intAdd = intAddMAX
List1.AddItem GenHex3
Text2.Text = List1.Text
myMac = CStr(Text2.Text)
myMac2 = Split(myMac, ":")
List3.AddItem myMac2(0) & ":" & myMac2(1) & ":" & myMac2(2)

List1.ListIndex = List1.ListIndex + 1
     intAdd = intAdd + 1
Loop

List1.ListIndex = List1.ListIndex + 1
End If
cleanList List1, filterSemi, ":", "" 'filtersemi = hardcode
Text1.Enabled = True
End Sub

Private Sub Command2_Click()
On Error Resume Next
Dim lngSave As Long
Set cdlg = CreateObject("MSComDlg.CommonDialog")

cdlg.Filter = "Text Files (.txt)|*.txt"
cdlg.filename = ""
cdlg.ShowSave
cdlg.DialogTitle = "Save List"
If LenB(cdlg.filename) = 0 Then Exit Sub
Dim filename As String
filename = cdlg.filename
'If Clear Then List2.Clear
If Check1.Value = 1 Then 'save without semicolons
Open filename$ For Output As #1
For lngSave& = 0 To filterSemi2.ListCount - 1
Print #1, filterSemi2.List(lngSave&)
Next lngSave&
Close #1
Else
Open filename$ For Output As #1
For lngSave& = 0 To List2.ListCount - 1
Print #1, List2.List(lngSave&)
Next lngSave&
Close #1
End If
MsgBox "Saved as " & filename, , ""
End Sub



Private Sub Command3_Click()
On Error Resume Next
List2.Clear 'delete old list
Text1.Enabled = False
Command4.Enabled = False
Command3.Enabled = False
Command2.Enabled = False
Command1.Enabled = False
List1.ListIndex = List1.ListIndex + 1
List3.ListIndex = List1.ListIndex
tmrTEST.Enabled = True

DoEvents
End Sub

Private Sub Command4_Click()
Dim lngSave As Long
Set cdlg = CreateObject("MSComDlg.CommonDialog")
cdlg.Filter = "Text Files (.txt)|*.txt"
cdlg.filename = ""
cdlg.ShowSave
cdlg.DialogTitle = "Save List"
If LenB(cdlg.filename) = 0 Then Exit Sub
Dim filename As String
filename = cdlg.filename
'If Clear Then List1.Clear
If Check1.Value = 1 Then 'save without semicolons
Open filename$ For Output As #1
For lngSave& = 0 To filterSemi.ListCount - 1
Print #1, filterSemi.List(lngSave&)
Next lngSave&
Close #1
Else
Open filename$ For Output As #1
For lngSave& = 0 To List1.ListCount - 1
Print #1, List1.List(lngSave&)
Next lngSave&
Close #1
End If
MsgBox "Saved as " & filename, , ""
End Sub

Private Sub Command5_Click()
On Error Resume Next
cleanList List1, List4, ":", ""
End Sub

Private Sub Form_Load()
On Error Resume Next
    Dim sFile As String
    Dim X As String 'testing
    sFile = "oui.csv"
    Open sFile For Input Access Read Shared As #1
    Do Until EOF(1)
    Line Input #1, X
    listVerMAC = Split(X, ",")
     listVert.AddItem CStr(listVerMAC(0))
     
     myArray(X) = CStr(listVerMAC(0))
     listVert2.AddItem CStr(listVerMAC(1))
     myArray2(X) = CStr(listVerMAC(1))
     Loop
    Close #1

    'MsgBox "Vertification File Loaded!", , ""
    listVert.ListIndex = listVert.ListIndex + 1
    DoEvents
    
End Sub


Private Sub Form_Unload(Cancel As Integer)
Unload Me
End Sub

Private Sub mnuAbout_Click()
MsgBox "NaMAG" & vbNewLine & "(Not Another MAC Address Generator)" & vbNewLine & _
"Coded by @KingRosenrot" & vbNewLine & _
"Features: " & vbNewLine & "+ Verifier using oui.csv" & vbNewLine & _
"+ Fast generation of Addresses" & vbNewLine & _
"+ Can save with or without semicolons" & vbNewLine & _
"+ Save as Generated or Save as Verified" & vbNewLine & _
"Version: " & APPVER, vbOKOnly, "N.a.M.A.G v " & APPVER
End Sub

Private Sub Text1_Change()
On Error Resume Next
  tVal = Text1.Text
  cVal = Len(Text1.Text)
  sVal = Mid(tVal, 1, tVal)
  If sVal = "0" Then
  tVal = Replace(tVal, "0", "")
  End If
  If IsNumeric(tVal) = True Then
nVal = tVal
End If

Text1.Text = CStr(nVal)
End Sub

Private Sub tmrBTN_Timer()
Command1.Enabled = True
Command4.Enabled = True
Command2.Enabled = True
tmrBTN.Enabled = False
End Sub

Private Sub tmrCNT_Timer()
On Error Resume Next
If tmrTEST.Enabled = False Then
Command3.Enabled = True
End If
Label1.Caption = "Generated: " & vbNewLine & List1.ListCount & vbNewLine & "Verified: " & vbNewLine & List2.ListCount & vbNewLine & "Identifiers: " & vbNewLine & listVert.ListCount
End Sub

Private Sub tmrTEST_Timer()
On Error Resume Next
Dim Item() As String
Dim i As Long

i = 0
If Option1.Value = True Then 'if hardcode is enabled

List3.ListIndex = List3.ListIndex + 1
For i = 0 To List3.ListCount - 1
    ReDim Preserve Item(i)
    Item(i) = listVert.List(i)
    If StrComp(UCase(Item(i)), List3.Text, vbTextCompare) = 0 Then
    List1.ListIndex = List3.ListIndex
    AddToListbox List1.Text, List2
    Exit For
    End If

Next i
ElseIf Option3.Value = True Then

'and place it into a new list for checking

List3.ListIndex = List3.ListIndex + 1
For i = 0 To List3.ListCount - 1
    ReDim Preserve Item(i)
    Item(i) = listVert.List(i)
    If StrComp(UCase(Item(i)), List3.Text, vbTextCompare) = 0 Then
    List1.ListIndex = List3.ListIndex
    AddToListbox List1.Text, List2
    Exit For
    End If

Next i

End If

If List3.ListIndex = List3.ListCount - 1 Then
cleanList List2, filterSemi2, ":", "" 'filtersemi = hardcode
Text1.Enabled = True
tmrTEST.Enabled = False
tmrBTN.Enabled = True
End If

List3.ListIndex = List3.ListIndex + 1
List1.ListIndex = List3.ListIndex
DoEvents
End Sub
